<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/include/taglibs.jsp"%>
<style>

</style>
<div id="left">
<h2>收藏此日志:</h2>
<h3>${saveFeedItemForm.title}</h3>
<form id="form1" name="saveFeedItemForm" method="post" action="saveFeedItem.html" onSubmit="former.ajaxSubmitForm();return false;">
<table class="detail">
	<spring:bind path="saveFeedItemForm.id">
		<input type="hidden" name="id" value="${status.value}" />
	</spring:bind>
	<tr>
		<td><label for="type">文章类型:</label></td>
		<td><input type="radio" name="type" value="1" checked>技术心得<br>
		<input type="radio" name="type" value="2">新闻<br>
		<input type="radio" name="type" value="3">其它</td>
	</tr>

	<tr>
		<td>标签：<spring:bind path="saveFeedItemForm.tagStr"></td>
		<td><input type="text" id="tagStr" name="tagStr" value="${status.value}"
			size=20 /> </spring:bind></td>
	</tr>

	<tr>
		<td align=center><input type="submit" class="button" name="save"
			value="收藏" /> <input type="button" class="button" name="cancel"
			value="返回" onclick="javascript:TB_remove();" /></td>
	</tr>

</table>

您的tag<a href="javascript:refreshTag()">>></a>
<div id="tags"></div>
</form>
</div>
<script type='text/javascript'>
var former = new AjaxFormer($$('form1'));
   var init=false;
   function clickTag(tag){
         var s=document.getElementById("tagStr").value;
         var i=s.indexOf(tag);
         if(i>=0){
         	document.getElementById("tagStr").value=s.substring(0,i)+s.substring(i+s.length+1,s.length);
			
        }else{
        	document.getElementById("tagStr").value=s+" "+tag;

        	}
   }
  
    function refreshTag()
    {
    if(!init){
       $("#tags").html("载入中...");
       $("#tags").load("listFansTag.ajax");
         init=true;
         $$("tags").style.display="inline";
          }else{
        	if($$("tags").style.display=="inline") {
    	  $$("tags").style.display="none";
    	     }else{
    	   $$("tags").style.display="inline";
    	   }
       }
    }
    
    function ajaxValidate(){
	 var str=$$("tagStr").value.trim();
    	if(str==""){ 
    	alert("请输入或选择标签"); 
    	return false;
    	}else{
    	return true;
    	}
	}
	
	function ajaxSucess(){
	$$("saveStatus_${saveFeedItemForm.id}").innerHTML="您已收藏";
	$$("saveCount_${saveFeedItemForm.id}").innerHTML=1+parseInt($$("saveCount_${saveFeedItemForm.id}").innerHTML);
    TB_remove();	     
	}
    

</script>

<div id="right">
<div class="tips">提示：输入您认为的标签，<b>用空格分隔多个标签</b>，就会将此日志形成文章推荐到相应标签下<br>
小技巧：标签也就是Tag，是为了您方便的管理文章，并在社区内更方便的与他人分享。建议标签简洁常用，比如spring，hibernate，ajax等，避免使用较长的标签</div>

</div>

